package com.MartynovichIgor.KnowledgeTest.resources;

import java.io.File;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.ResourceBundle;

/**
 * Класс хранит данные для английской локализации.
 */
public class MyResources_en extends ResourceBundle {
    /**
     * Поле хранящее набор всех данных в виде ключ значение.
     */
    private HashMap<String, Object> resources;


    private String question1 = "2@What programming language is Java?.@Average typing;Strong typing;Weak typing" +
            "@Strong typing@1";
    private String question2 = "2@How much of Java primitive types?@8;7;9@8@2";
    private String question3 = "1@Java uses UTF-8 encoding.@yes/no@no@3";
    private String question4 = "1@The basic container for storing sequences of identical " +
            "elements in Java are ___.@Insert the missing words.@array@4";
    private String question5 = "1@The main programmatic unity of Java is ___?@Insert the missing word.@class@5";
    private String question6 = "1@Methods for partitioning the code and its generalization defines " +
            "___ programming.@Insert the missing words.@paradigm@6";
    private String question7 = "2@How many access modifiers in Java?@3;2;4@4@7";
    private String question8 = "1@The class constructor never returns.@yes/no@yes@8";
    private String question9 = "2@What class in Java is a metaclass.@Object;Class;Runtime@Class@9";
    private String question10 = "2@What is the default access modifier have the interface methods?" +
            "@protected;public;private@public@10";

    /**
     * Поле с вопросами на английском для теста.
     */
    private ArrayList<String> questions = new ArrayList<String>();
    {
        questions.add(question1);
        questions.add(question2);
        questions.add(question3);
        questions.add(question4);
        questions.add(question5);
        questions.add(question6);
        questions.add(question7);
        questions.add(question8);
        questions.add(question9);
        questions.add(question10);
    }

    public MyResources_en() {
        resources = new HashMap<String, Object>();
        resources.put("filePath", new ProjectPath().getProjectPath()+
                "src/com/MartynovichIgor/KnowledgeTest/resources/TestFileEnglish.csv");
        resources.put("sourceString", questions);
        resources.put("Score", "Your score: ");
        resources.put("a", "a)");
        resources.put("b", "b)");
        resources.put("c", "c)");
        resources.put("d", "d)");
        resources.put("e", "e)");
        resources.put("registration", "For registration enter -  register, for login enter -  login:");
        resources.put("registrationValidation", "Please write register or login.");
        resources.put("login", "Please enter your login:");
        resources.put("pass", "Please enter your password:");
        resources.put("loginExists", "Sorry, this login already exists. \n Enter new login:");
        resources.put("loginAgain", "User with this login does not exist, please try again or register.\n");
        resources.put("lastScore", "\nHello, you've already passed our test.\nYour last result was: ");
        resources.put("newStart", "\nNow the new test will start for you...\n");
        resources.put("emptyLogin", "Login can not be empty! Enter your login: ");
        resources.put("emptyPassword", "Password can not be empty! Enter your password: ");
        resources.put("help", "\nCongratulations, if you read this text, you already authorized in our test system.\n" +
                "Before you start, read this help:\n" +
                "---------------------------------" +
                "\nTo skip a question - click enter.\n" +
                "---------------------------------" +
                "\nTo previous question - enter undo\n" +
                "---------------------------------" +
                "\nTo leave the test - enter exit\n" +
                "---------------------------------" +
                "\nWish good luck to you:)" +
                "\n\n\n");
        resources.put("adminHelp", "Hello God! For watch users info - enter \"info\",\n " +
                "for delete user - enter \"delete\",\nfor view one user statistics - enter \"u_stat\"\n " +
                "for view all statistics - enter \"stats\"" );
        resources.put("deadUser", "Enter login to delete User.");
        resources.put("seeUserStat", "Enter login to see statistics.");
    }

    @Override
    protected Object handleGetObject(String key) {
        return resources.get(key);
    }

    @Override
    public Enumeration<String> getKeys() {
        return (Enumeration<String>) resources.keySet();
    }
}
